<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/region.css" />
    <!--css-->
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/houselease.css" />
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.fix.js"></script>
    <script type="text/javascript">

    // jssdk config 对象
    jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};

    // 是否启用调试
    jssdkconfig.debug = false;

    jssdkconfig.jsApiList = [

        'previewImage',

    ];
    </script>
    <title>{$region['title']}</title>
</head>

<body>
    <!--page-->
    <div id="page">
        <header id="header">
            <div class="header_div">
                <div id="left_div" onClick="window.location.href='{php echo $this->createMobileUrl('houselease',array('op' => 'list'))}'"></div>
                <div id="middle_div">
                    <h1 id="title">房屋{if $item['category'] == 1}出租{elseif $item['category'] == 2} 求租{elseif $item['category'] == 3}出售 {else} 求购{/if}</h1></div>
                <div id="right_div">
                    <div class="right_bottom"></div>
                    <div class="right_img"></div>
                </div>
            </div>
        </header>
        <!--cont-->
        <div class="cont" style="padding-bottom:100px;">
            <aside id="houseimg_img" onClick="showImg()">
                <div class="house_img"><img src="{$imgs[0]['src']}" style="max-height:300px;_height:expression(this.height> 300 ? " 300px " : this.height);margin:0 auto;"/></div>
                <div style="display:none" id="previewImage">
                {loop $imgs $img}
                <img  src="{$img['src']}" />
                {/loop}

                </div>
                <div class="house_b"><span>共{php echo count($imgs)}张图</span></div>
            </aside>
            <aside id="houseimg_title">
                <h1 class="house_title">{$item['title']}</h1>
                <div class="fab_time">发布时间：{php echo date('Y-m-d H:i',$item['createtime'])}&nbsp;&nbsp;&nbsp;&nbsp;<!--预留 浏览量： --></div>
            </aside>
            <section class="housexq_div">
                <div class="house_xq">
                    <div class="xq_l">
                        <ul class="house_xqul">
                            <li>
                                <label>出租方式：</label>{if $item['way'] == 1} 整套出租{elseif $item['way'] == 2}单间出租{else} 床位出租{/if}</li>
                            <li>
                                <label>房屋户型：</label>{$item['model_room']}室{$item['model_hall']}厅{$item['model_toilet']}卫</li>
                            <li>
                                <label>面积：</label>{$item['model_area']}m<sup>2</sup></li>
                            <li>
                                <label>楼层：</label>{$item['floor_layer']}/{$item['floor_number']}层</li>
                            <li>
                                <label>装修情况：</label>{$item['fitment']}</li>
                            <li>
                                <label>押金方式：</label>{$item['price_way']}</li>
                            <li>
                                <label>住宅类型：</label>{$item['house']}</li>
                            <li>
                                <label>最早入住：</label>{$item['checktime']}</li>
                        </ul>
                    </div>
                    <div class="xq_r">
                        <span class="price">{$item['price']}</span>
                        <div class="other_info" style="text-align:center; padding:5px;"><span>{$item['price_way']}</span></div>
                        <!-- 预留-->
                        <!-- <div class="house_rz norz">
                            <div class="rz_l"><span class="rz_ms">认证</span></div>
                            <div class="rz_r">个人</div>
                        </div> -->
                    </div>
                </div>
                <dl class="shebei">
                    <dt>房屋配置：</dt>
                    <dd style="width:80%;">
                        {$item['allocation']}</dd>
                    
                </dl>
            </section>
            <aside class="housexq_div">
                <h2>其他说明：</h2>
                <ul class="house_xqul">
                    <li>
                        <label>发布人：</label>{$item['realname']}</li>
                    <!-- <li>
                        <label>联系方式：</label>{$item['mobile']}</li> -->
                    <li>
                        <label>是否成交：</label><span style="color:#008CD6;">{if $item['status']}已成交 {else}还未成交{/if}</span></li>
                    <li>
                        <label>其他说明：</label>
                        <p>{$item['content']}</p>
                    </li>
                </ul>
            </aside>
        </div>

        <!--panel end-->
        <!-- #EndLibraryItem -->
        <!--右边点击菜单-->
        <div id="btn_div">
            <div id="btn_dj"><span id="btn_input" class="btn_img hide_b"></span></div>
            <div id="menu_b" class="menu_btn hide_m"><a href="{php echo $this->createMobileUrl('houselease',array('op' => 'add','category' => 1))}">发布信息</a><a href="">我的发布</a></div>
        </div>
        <script>
        $(function() {
            $("#btn_div").fix({
                right: 0,
                bottom: 120
            })
            $("#btn_dj").click(function() {
                var input_btn = $("#btn_input")
                if (input_btn.attr("class") == "btn_img hide_b") {
                    input_btn.removeClass();
                    input_btn.addClass("btn_img show_b");
                } else {
                    input_btn.removeClass();
                    input_btn.addClass("btn_img hide_b");
                }
                var menu_b = $("#menu_b")
                if (menu_b.attr("class") == "menu_btn hide_m") {
                    menu_b.removeClass();
                    menu_b.addClass("menu_btn show_m");
                } else {
                    menu_b.removeClass();
                    menu_b.addClass("menu_btn hide_m");
                }
            })
        })
        </script>
        <!--底部信息-->
        <aside class="house_foot">
            <a href="tel:{if $set['h_status']}{$region['linkway']}{/if}">
                <div class="house_div">
                {if $set['h_status']}
                    <div class="hfoot_l"><span>{$region['linkmen']}</span><span>{$region['linkway']}</span></div>
                {else}
                    <div class="hfoot_l"><span>{$item['realname']}</span><span>{$item['mobile']}</span></div>
                {/if}
                    <div class="hfoot_r">
                        <div class="hf_img"><span></span></div><span class="gotel">去电话</span></div>
                </div>
            </a>
        </aside>
    </div>
    <!--page end-->

 <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">

wx.config(jssdkconfig);

// $(document).on('click', '#previewImage img',function(event) {
//         var imgArray = [];
//         var curImageSrc = $(this).attr('src');
//         alert(curImageSrc);
//         if (curImageSrc) {
//             $('#previewImage img').each(function(index, el) {
//                 var itemSrc = $(this).attr('src');
//                 imgArray.push(itemSrc);
//             });
  
//                 wx.previewImage({
//                     current: curImageSrc,
//                     urls: imgArray
//                 });
        
//         }
  
//  });
function showImg(){

   var imgArray = [];
        var curImageSrc = $(".house_img img").attr('src');
        if (curImageSrc) {
            $('#previewImage img').each(function(index, el) {
                var itemSrc = $(this).attr('src');
                imgArray.push(itemSrc);
            });
  
                wx.previewImage({
                    current: curImageSrc,
                    urls: imgArray
                });
        
        } 
}

</script>
</body>

</html>
